package com.zw.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.zw.annotation.Excel;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 模板字段信息
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "templateColumns", description = "模板字段信息")
@TableName("pt_template_columns")
public class TemplateColumns implements Serializable {

    @Schema(description = "主键ID")
    private Long id;

    @Schema(description = "模板ID")
    private Long templateId;

    @Excel(name = "字段名称")
    @Schema(description = "字段名称")
    @NotBlank(message = "字段名称不能为空")
    private String column;

    @Excel(name = "字段中文名称")
    @Schema(description = "字段中文名")
    @NotBlank(message = "字段中文名不能为空")
    private String columnName;

    @Excel(name = "字段类型")
    @Schema(description = "字段类型")
    @NotBlank(message = "字段类型不能为空")
    private String columnType;

    @Excel(name = "排序")
    @Schema(description = "排序")
    private Integer sort;

    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @Schema(description = "可见性")
    private Integer visible;

    @Schema(description = "是否固定")
    private Integer fixed;

    @Schema(description = "删除标志")
    @TableLogic(value = "0", delval = "1")
    private Integer delFlag;

    @Schema(description = "属性操作 0无 1叠加 2均值")
    private Integer operationType;
}
